package com.joyoung.common.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;

import android.provider.Settings;


import com.joyoung.common.AppConfig;

import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Locale;

/**
 * 设备信息工具类
 *
 */
@SuppressWarnings("unused")
public class DeviceInfoUtils {

    private DeviceInfoUtils() {}

    /** 获取基础信息 */
    public static List<String> getBaseInfo() {
        List<String> list = new ArrayList<>();
        list.add("Date: " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA).format(new Date()));
        Context context = AppUtil.getContext();
        if (context != null) {
            list.add("VersionName: " + DeviceUtil.getVersionName(context));
            list.add("VersionCode: " + DeviceUtil.getVersionCode(context));
            list.add("DeviceNumber: " + CodeGenerator.generateUniqueDeviceCode(context));
        }
        return list;
    }

    /** 获取Android系统信息 */
    @SuppressLint("HardwareIds")
    public static List<String> getAndroidInfo() {
        List<String> list = new ArrayList<>();
        try {
            list.add("Android 版本(release): " + Build.VERSION.RELEASE);
            list.add("Android 版本(display): " + Build.DISPLAY);
            list.add("Android SDK: " + Build.VERSION.SDK_INT);
            list.add("品牌(BRAND): " + Build.BRAND);
            list.add("产品型号(PRODUCT): " + Build.PRODUCT);
            list.add("主板型号(BOARD): " + Build.BOARD);
            list.add("设备型号(DEVICE): " + Build.DEVICE);
            list.add("设备名称(MODEL): " + Build.MODEL);
            list.add("设备序列号(SERIAL): " + Build.SERIAL);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                list.add("支持ABIS(SUPPORTED_ABIS): " + Arrays.toString(Build.SUPPORTED_ABIS));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

   

}
